find minimum element in array